package com.dj.ms.controller;

import com.dj.ms.annotation.Unauthorize;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <br>
 * <p>
 * -        健康检查
 * </p>
 *
 * <br>
 *
 * @author ZJG
 * @version 1.0
 * @date 2021/11/5 下午4:32
 */
@Controller
public class HealthCheckController {

    @Value("${spring.application.name:application}")
    private String applicationName;

    @RequestMapping(value = {
            "/common/health",
            "/actuator/health/",
            "/actuator/health/**",
            "/actuator/health/readiness",
            "/actuator/health/liveness"
    })
    @Unauthorize
    @ResponseBody
    public String healthCheck() {
        return applicationName + " is alive";
    }


}
